<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>管理后台</title>
    <link rel="stylesheet" href="/static/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/css/public.css" media="all" />
</head>
<body class="childrenBody">
<div class="layui-row layui-col-space10">
    <div class="layui-col-lg6 layui-col-md12">
        <blockquote class="layui-elem-quote title">近30天数据统计</blockquote>
        <div class="layui-elem-quote layui-quote-nm magb0">
            <div class="" id="index_echar" style="height:383px"></div>
        </div>
    </div>
    <div class="layui-col-lg6 layui-col-md12">
        <blockquote class="layui-elem-quote title">系统基本参数</blockquote>
        <table class="layui-table magt0">
            <colgroup>
                <col width="150">
                <col>
            </colgroup>
            <tbody>
                <tr>
                    <td>当前登录账号</td>
                    <td class="version">{$Think.session.nickname}</td>
                </tr>
                <tr>
                    <td>上次登录时间</td>
                    <td class="author">{$Think.session.lastlogintime}</td>
                </tr>
                <tr>
                    <td>上次登录IP</td>
                    <td class="homePage">{$Think.session.lastloginip}</td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
<script src="/static/layui.js"></script>
<script src="/static/echarts.min.js"></script>
<script>
    layui.use(['element','laypage','jquery'], function(){
        var element = layui.element;
        var $ = layui.$;
        var myChart = echarts.init(document.getElementById('index_echar'));
        window.onresize = myChart.resize;
        var colors = ['#5793f3', '#d14a61', '#675bba'];
        $.get('{:url("index/indexData")}',function (data) {
            myChart.setOption({
                title : {
                    show: false
                },
                color: colors,
                tooltip: {
                    trigger: 'axis',
                    axisPointer: {
                        type: 'cross'
                    }
                },
                grid: {
                    right: '20%'
                },
                legend: {
                    data:['新增会员数'],
                    left: 'center'
                },
                xAxis: [
                    {
                        type: 'category',
                        axisLabel:{rotate:-45,interval:1},
                        data: data['xaxis']
                    }
                ],
                yAxis: [
                    {
                        type: 'value',
                        name: '新增会员数',
                        position: 'left',
                        minInterval: 1,
                        axisLine: {
                            lineStyle: {
                                color: colors[0]
                            }
                        },
                        axisLabel: {
                            formatter: '{'+'value}'
                        }
                    }
                ],
                series: [
                    {
                        name:'新增会员数',
                        type:'bar',
                        data:data['yaxis']
                    }
                ]
            });
        });
    });
</script>
</body>
</html>